FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block prometheus_cadvisor_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% block prometheus_cadvisor_repository_version %}
ARG prometheus_cadvisor_version=0.45.0
{% if debian_arch == 'arm64' %}
ARG prometheus_cadvisor_sha256sum=bd6dad982c5950d6071ec2e1f9d474102ef3a00451395c58da9398297d35b174
{% else %}
ARG prometheus_cadvisor_sha256sum=9a2a0b69f58d932855c0af23b847cb9de8f8c32264f66f9fb5dcc8f359f34ccd
{% endif %}
ARG prometheus_cadvisor_url=https://github.com/google/cadvisor/releases/download/v${prometheus_cadvisor_version}/cadvisor-v${prometheus_cadvisor_version}-linux-{{debian_arch}}
{% endblock %}


{% block prometheus_cadvisor_install %}
RUN curl -o /tmp/cadvisor ${prometheus_cadvisor_url} \
    && echo "${prometheus_cadvisor_sha256sum} /tmp/cadvisor" | sha256sum -c \
    && mv /tmp/cadvisor /opt \
    && chmod 0755 /opt/cadvisor
{% endblock %}


{% block prometheus_cadvisor_footer %}{% endblock %}
{% block footer %}{% endblock %}
